<?php

class RegisterController extends Zend_Controller_Action {

    public function init() {
        /* Initialize action controller here */
    }

    public function indexAction() {
        $form = new Application_Form_People();
        $form->submit->setLabel('Add');
        $this->view->form = $form;
        if ($this->getRequest()->isPost()) {
            $formData = $this->getRequest()->getPost();
            if ($form->isValid($formData)) {
                $death_reason = $form->getValue('death_reason');
                $gender = $form->getValue('gender');
                $mother_id = $form->getValue('mother_id');
                $father_id = $form->getValue('father_id');
                $narrative = $form->getValue('narrative');
                $updated = $form->getValue('updated');
                $creator_id = $form->getValue('creator_id');
                $created = $form->getValue('created');
                $editor_id = $form->getValue('editor_id');
                $users = new Application_Model_People();
                $users->addUser($death_reason, $gender, $mother_id, $father_id, $narrative, $updated, $creator_id, $created, $editor_id);
                $this->_helper->redirector('index');
            } else {
                $form->populate($formData);
            }
        }
    }

    public function insertAction() {
        // action body
    }

    public function editAction() {
        // action body
    }

    public function deleteAction() {
        // action body
    }

    public function listAction() {
        // action body
    }

}

